package com.toolbox.service.impl;

import com.toolbox.bo.AccountBO;
import com.toolbox.dal.repository.InfraUserRoleDORepository;
import com.toolbox.req.InfraUserRoleReq;
import com.toolbox.service.InfraUserRoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * 用户角色表 服务实现类
 * </p>
 *
 * @author Mango
 * @since 2023-12-01
 */
@SuppressWarnings("ALL")
@Slf4j
@Service
public class InfraUserRoleServiceImpl implements InfraUserRoleService {

    /**
     * 用户角色表 服务类
     */
    @Autowired
    private InfraUserRoleDORepository repository;

    @Override
    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
    public List<Long> createUserRole(InfraUserRoleReq req, AccountBO bo) {
        return repository.createUserRole(req,bo);
    }

    @Override
    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
    public void removeById(Long id) {
        repository.removeById(id);
    }
}
